package db

func ConvObjToPtr[T DbEntity](i T) (o *T) {
	return &i
}

func ConvPtrToObj[T DbEntity](i *T) (o T) {
	return *i
}

func MapObjToPtr [T DbEntity] (list []T) []*T {
	ptrs := make([]*T, len(list))
	for i := range list {
		ptrs[i] = &list[i]
	}
	return ptrs
}

func MapPtrToObj [T DbEntity] (list []*T) []T {
	ptrs := make([]T, len(list))
	for i := range list {
		ptrs[i] = *list[i]
	}
	return ptrs
}
